package com.foredu.fiqs.domain;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

/**
 * Description:<br/>
 * 领域模型：工资条目类型，记录工资条目类型<br/>
 * Date:<br/>
 * 2014/5/13<br/>
 * 
 * @author hushigang
 */

@Entity
@Table(name = "T_SalaryItemType")
public class SalaryItemType implements Serializable {

	private static final long serialVersionUID = 1L;
	private int id;// 工资条目类型ID
	private String name;// 工资条目类型名称
	private Set<SalaryItemDetailType> detailTypes;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(cascade=CascadeType.ALL, mappedBy = "type")
	@OrderBy(value = "id ASC")
	public Set<SalaryItemDetailType> getDetailTypes() {
		return detailTypes;
	}

	public void setDetailTypes(Set<SalaryItemDetailType> detailTypes) {
		this.detailTypes = detailTypes;
	}
}
